#include <iostream>

using namespace std;

int main() {
	int a;
	while(true) {
		cin >> a;
		if (a == 0) break;
		int n = 0;
		while (a >> n != 0) {
			n++;
		}
		cout << n << endl;
	}
}